﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StockInfo.aspx.cs" Inherits="morning_StockInfo" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.query.url.js" type="text/javascript"></script>
      <script src="../My97DatePicker/WdatePicker.js"></script>
<script>
    $(document).ready(function () {
        $("#btnSelect").click(function () {
            var userName = $("#txtUserName").val()
//            id = encodeURI(id);
            var code = $("#txtCode").val();
            var sell = $("#ddlSell").val();
            var date = $("#stime").val(); 
            name = encodeURI(name);
            var url = "StockInfo.aspx?";
            var con = "";
            if (userName != "") {
                if (con != "") {
                    con += "&userName=" + userName;
                }
                else {
                    con = "userName=" + userName;
                }
            }
            if (code != "") {
                if (con != "") {
                    con += "&code=" + code;
                }
                else {
                    con = "code=" + code;
                }
            }
            if (sell != "") {
                if (con != "") {
                    con += "&sell=" + sell;
                }
                else {
                    con = "sell=" + sell;
                }
            }
            if (date != "") {
                if (con != "") {
                    con += "&date=" + date;
                }
                else {
                    con = "date=" + date;
                }
            }
            document.location = url + con;
        })
    })
</script>
</head>
<body>
   <div class="page_title">股动中国实盘数据</div>
    <form id="form1" runat="server">
    <div class="button_bar">
        <asp:Button ID="btnAdd" CssClass="common_button" runat="server" Text="添加" OnClientClick="document.location='addStockInfo.aspx';return false;" />
       <input type="button" id="btnSelect" value="查询" class="common_button" />
         
    </div>
    <table class="query_form_table"style="width:60%" >
        <tr>
            <th>
                用户名
            </th>
            <td>
                <input type="text" id="txtUserName" />
            </td>
              <th>
                买卖方向
            </th>
            <td>
            <asp:DropDownList ID="ddlSell" runat="server" DataTextField="name" 
                DataValueField="id" AppendDataBoundItems="True">
                <asp:ListItem>买入</asp:ListItem>
                <asp:ListItem>卖出</asp:ListItem>
            </asp:DropDownList>
             &nbsp;</td>
           
          
        </tr>
        <tr>
           <th>
                股票代码</th>
            <td>
                <input type="text" id="txtCode" />
            </td>
            <th>
                交易日期</th>
            <td>
        <input class="Wdate" type="text" id="stime" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
            </td>
          
        </tr>
    </table>
    <table class="data_list_table">
        <tr>
            <th>
                id
            </th>
            <th>
                用户名
            </th>
            <th>
                股票代码
            </th>
            <th>
                股票名称
            </th>
            <th>
                方向
            </th>
            <th>
                价格
            </th>
             <th>
                数量
            </th>
            <th>
                交易日期
            </th>
             <th>
                操作
            </th>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server" >
            <ItemTemplate>
                <tr>
                    <td class="list_data_number" align="center">
                        <%# Eval("id") %>
                    </td>
                    <td class="list_data_text">
                        <%# Eval("userName") %>
                    </td>
                    <td class="list_data_text">
                        <%# Eval("stockCode")%>
                    </td>
                    <td class="list_data_text">
                        <%# Eval("stockName")%>
                    </td>
                    <td class="list_data_ltext">
                        <%# Eval("buyOrSell")%>
                    </td>
                          <td class="list_data_ltext">
                        <%# Eval("wtprice")%>
                    </td>
                          <td class="list_data_ltext">
                        <%# Eval("num")%>
                    </td>
                          <td class="list_data_ltext">
                        <%# Eval("wtDate")%>
                    </td>
                    <td class="list_data_ltext">
                        <a href='EditStockInfo.aspx?id=<%# Eval("id") %>&page=<%=GetPage() %>'>
                            <img src="../images/bt_edit.gif" alt="修改" title="修改" /></a> <a href='DelStockInfo.aspx?id=<%# Eval("id") %>&page=<%=GetPage() %>' onclick="return confirm('确定删除？')">
                                <img src="../images/bt_del.gif" alt="删除" />
                            </a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <th colspan="9" class="pager">
                <div class="pager">
                    <webdiyer:AspNetPager ID="AspNetPager1" runat="server"
                        PageSize="10" onpagechanged="AspNetPager1_PageChanged" 
                        onpagechanging="AspNetPager1_PageChanging">
                    </webdiyer:AspNetPager>
                </div>
            </th>
        </tr>
    </table>
    </form>
</body>
</html>
